package cheme.ProcessModel.Interpreter;

import cheme.ProcessModel.IModelElement;

public interface IRule
{
	public class RuleResult
	{
		private String message = "";
		private IModelElement source = null;
		
		public RuleResult(IModelElement source)
		{
			this(source, "");
		}
		
		public RuleResult(IModelElement source, String message)
		{
			setSource(source);
			setMessage(message);
		}

		public String getMessage()
		{
			return message;
		}

		public void setMessage(String message)
		{
			this.message = message;
		}
		
		@Override
		public String toString()
		{
			return getMessage();
		}

		public IModelElement getSource()
		{
			return source;
		}

		public void setSource(IModelElement source)
		{
			this.source = source;
		}
	}
	
	public class Success extends RuleResult
	{
		public Success(IModelElement source)
		{
			this(source, "");
		}
		
		public Success(IModelElement source, String message)
		{
			super(source, message);
		}
	}
	
	public class Warning extends RuleResult
	{
		public Warning(IModelElement source)
		{
			this(source, "");
		}
		
		public Warning(IModelElement source, String message)
		{
			super(source, message);
		}
	}
	
	public class Failure extends RuleResult
	{
		public Failure(IModelElement source)
		{
			this(source, "");
		}
		
		public Failure(IModelElement source, String message)
		{
			super(source, message);
		}
	}
	
	RuleResult applyTo(IModelElement object);
}
